package edu.tsp.ga.utils;

import java.util.Random;

public class RandomGenerator {

    private static Random random = new Random(System.currentTimeMillis());

    public static int nextInt(int bound) {
        return random.nextInt(bound);
    }

    public static Pair<Integer, Integer> generateCrossPoints(int size) {
        int p1 = RandomGenerator.nextInt(size);
        int p2 = RandomGenerator.nextInt(size);
        while (p1 == p2) {
            p2 = RandomGenerator.nextInt(size);
        }
        return new Pair<>(p1, p2);
    }

    public static double nextDouble() {
        return random.nextDouble();
    }

}
